<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>

<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width,initial-scale=1,user-scalable=0">
<title></title>
<link rel="stylesheet" href="/css/weui-for-work.min.css">
<link rel="stylesheet" href="/css/baguetteBox.css">
<script type="text/javascript" src="/js/baguetteBox.js"></script>
</head>

<body>

	<div class="page__bd">

		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">请假类型:</label>
			</div>
			<div class="weui-cell__bd">
				<s:if test="${info.qingJiaTypeId==1083}">
					<s:out value="事假"></s:out>
				</s:if>
				<s:if test="${info.qingJiaTypeId==1084}">
					<s:out value="年假"></s:out>
				</s:if>
				<s:if test="${info.qingJiaTypeId==1085}">
					<s:out value="病假"></s:out>
				</s:if>
			</div>
		</div>

		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">开始日期:</label>
			</div>
			<div class="weui-cell__bd">
				<input class="weui-input" id="startTime" type="text"
					value='<f:formatDate value="${info.startTime}"  pattern="yyyy-MM-dd hh:mm:ss" />' />
			</div>
		</div>


		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">截止日期:</label>
			</div>
			<div class="weui-cell__bd">
				<input class="weui-input" id="endTime" type="text"
					value='<f:formatDate value="${info.startTime}"  pattern="yyyy-MM-dd hh:mm:ss" />' />
			</div>
		</div>


		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">请假天数:</label>
			</div>
			<div class="weui-cell__bd">
				<input class="weui-input" id="days" type="text" value="${info.days}"
					placeholder="按每天8小时折算,允许小数" />
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">备注:</label>
			</div>
			<div class="weui-cells weui-cells_form">
				<div class="weui-cell">
					<div class="weui-cell__bd">
						<textarea class="weui-textarea" id="remark" placeholder=""
							rows="2"> ${info.remark}&nbsp; </textarea>
						<div class="weui-textarea-counter">
							<span id="count">0</span>/200
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="weui-cells weui-cells_form">
			<!--图片上传-->
			<div class="weui-gallery" id="gallery">
				<span class="weui-gallery__img" id="galleryImg"></span>
				<div class="weui-gallery__opr">
					<a href="javascript:" class="weui-gallery__del"> <i
						class="weui-icon-delete weui-icon_gallery-delete"></i>
					</a>
				</div>
			</div>
			<div class="weui-cells weui-cells_form" id=uploaderCustom>
				<div class=weui-cell>
					<div class="gallery baguetteBoxOne">
					    
					
					    <s:if test="${info.picture!=null and info.picture!=''}">
					     <a href="/uploadImage/${info.picture}"> <img width="100px" height="80px" src="/uploadImage/${info.picture}"
							>
						</a> 
						</s:if>
						  <s:if test="${info.bak1!=null and info.bak1!=''}">
					     <a href="/uploadImage/${info.bak1}"> <img width="100px" height="80px" src="/uploadImage/${info.bak1}"
							>
						</a> 
					   </s:if>
					     <s:if test="${info.bak2!=null and info.bak2!=''}">
					     <a href="/uploadImage/${info.bak2}"> <img width="100px" height="80px" src="/uploadImage/${info.bak2}"
							>
						</a> 
					   </s:if>
					</div>
				</div>
			</div>

		</div>

	</div>
	<s:if test="${info.checkerId==0}">
		<div class="page__bd page__bd_spacing">
			<a href="javascript:;" class="weui-btn weui-btn_primary"
				onclick="javascript:recover('${info.id}');">撤销申请</a>
		</div>
	</s:if>





</body>
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
    var bak1 = "/\s /"

    baguetteBox.run('.baguetteBoxOne');

	var type = "${info.qingJiaTypeId}";
	if (type == "1083") {
		type = "事假";
	} else if (type == "1084") {
		type = "年假";
	} else if (type == "1085") {
		type = "病假";
	} else {
		type = null;
	}

	function recover(id) {
		var id = "${info.id}"
		var days = "${info.days}";
		var startTime = $("#startTime").val();
		$.ajax({
			dataType : "json",
			url : "/askleave/recover",
			type : "get",
			data : {
				"id" : id
			},
			success : function(data) {
				alert(data.message);
				window.location.href = "/phone/valiteCurrentUser?condition=1";
			}
		})

	}
</script>

</html>